;(function() {

  /**
   * 处理复杂类型
   * @param {string} target 
   * @param {string} typeName 
   * @returns { boolean | string }
   */
  const typeOf = (target, typeName = undefined) => {
    const text = Object.prototype.toString.apply(target);
    const type = /^\[object (\w+)]$/.exec(text)[1].toLocaleLowerCase();
    return typeName ? typeName === type : type
  }
  
  /**
    * 判断空值(v[,v,v...])
    * @returns { boolean }
  */
  const empty = (/* ...arguments */) => {
    if(arguments.length > 1) {
      // 多个值的时候判断都为空
      return [...arguments].every(v => empty(v));
    } else {
      switch(typeOf(arguments[0])) {
        case 'array':
        case 'string':
        case 'object': return Object.keys(arguments[0]).length === 0;
        default: return arguments[0] === null;
      }
    }
  }

}.call(this));